<template>
  <a-card :bordered='false'>
    <!-- 查询区域 -->
    <div class='table-page-search-wrapper'>
      <a-form layout='inline' @keyup.enter.native='searchQuery'>
        <a-row :gutter='24'>
          <a-col :md='6' :sm='12'>
            <a-form-model-item label='科目' prop='subjectId'>
              <j-dict-select-tag v-model='serchParams.subjectId' placeholder='请选择科目'
                                 dictCode='cou_subject,subject_name,id' />
            </a-form-model-item>
          </a-col>

          <a-col :md='6' :sm='12'>
            <a-form-model-item label='标准用途' prop='achievementStandardPurpose'>
              <j-dict-select-tag type='list' v-model='serchParams.achievementStandardPurpose'
                                 dictCode='achievement_standard_purpose' placeholder='选择是标准用途' />
            </a-form-model-item>
          </a-col>

          <template v-if='toggleSearchStatus'>
            <a-col :md='6' :sm='8'>
              <a-form-model-item label='标准类型' prop='achievementStandardTtype'>
                <j-dict-select-tag type='list' v-model='serchParams.achievementStandardTtype' placeholder='选择标准类型'
                                   dictCode='achievement_standard_ttype' />
              </a-form-model-item>
            </a-col>
            <a-col :md='6' :sm='8'>
              <a-form-model-item label='启用状态'>
                <j-dict-select-tag type='list' v-model='serchParams.izOpen'
                                   dictCode='iz_open' placeholder='选择是否启用状态' />
              </a-form-model-item>
            </a-col>
          </template>

          <a-col :md='6' :sm='8'>
            <span style='float: left;overflow: hidden;' class='table-page-search-submitButtons'>
              <a-button type='primary' @click='whereSerchAchAchieStandard' icon='search'>查询</a-button>
              <a-button type='primary' @click='whereSerchAchAchieStandardInit' icon='reload'
                        style='margin-left: 8px'>重置</a-button>
              <a @click='handleToggleSearch' style='margin-left: 8px'>
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
              </a>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class='table-operator'>
      <a-button @click='handleAdd' type='primary' icon='plus'>新增标准</a-button>
      <a-button type='primary' icon='download' @click="handleExportXls('ach_achievement_standard')">导出</a-button>
      <a-upload name='file' :showUploadList='false' :multiple='false' :headers='tokenHeader' :action='importExcelUrl'
                @change='handleImportExcel'>
        <a-button type='primary' icon='import'>导入</a-button>
      </a-upload>
      <!-- 高级查询区域 -->
      <!--      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
      <a-dropdown v-if='selectedRowKeys.length > 0'>
        <a-menu slot='overlay'>
          <a-menu-item key='1' @click='batchDel'>
            <a-icon type='delete' />
            删除
          </a-menu-item>
        </a-menu>
        <a-button style='margin-left: 8px'> 批量操作
          <a-icon type='down' />
        </a-button>
      </a-dropdown>
      <template>
        <span style="float:right;">
          <a @click="searchQuery()"><a-icon type="sync" />刷新</a>
          <a-divider type="vertical" />
          <a-button v-print="'#datatable'" ghost type="primary">打印</a-button>
        </span>
      </template>

      <!-- 给试卷评分标准分配 -->
      <a-button style='background-color: #e9af00;border: none;' @click='addAchieveStandardPaper' type='primary'
                icon='plus'>开始分配评分标准
      </a-button>
      <a-button @click='handleAddItem' type='primary' icon='plus'>新增标准分项明细</a-button>
    </div>

    <!-- table区域-begin -->
    <div>
      <div class='ant-alert ant-alert-info' style='margin-bottom: 16px;'>
        <i class='anticon anticon-info-circle ant-alert-icon'></i> 已选择 <a
        style='font-weight: 600'>{{ selectedRowKeys.length }}</a>项
        <a style='margin-left: 24px' @click='onClearSelected'>清空</a>
      </div>

      <a-table
        id="datatable"
        ref='table'
        size='middle'
        :scroll='{x:true}'
        :expandedRowKeys='expandedRowKeys'
        @expand='fatherExpand'
        bordered
        rowKey='id'
        :columns='columns'
        :dataSource='dataSourceStandard'
        :pagination='ipagination'
        :loading='loading'
        :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
        class='j-table-force-nowrap'>
        <span slot='action' slot-scope='text, record'>
          <a @click='handleEdit(record)'><a-icon type='edit' /></a>
          <a-popconfirm title='确定删除吗?' @confirm='() => handleCoursePlanDelete(record.id)'>
            <a style='margin-left: 10px;color: #e52441;margin-left: 20px;'><a-icon type='delete' /></a>
          </a-popconfirm>
        </span>

        <!-- 嵌入子table -->
        <a slot='operation' slot-scope='text'>Publish</a>
        <a-table
          slot='expandedRowRender'
          style='background-color: #eaeaea'
          slot-scope='record'
          :columns='innerColumns'
          :dataSource='itemDataSource'
          :pagination='false'
          :loading='loading'
          :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChangeItem}'
          class='components-table-demo-nested'
          bordered>

          <span slot='action' slot-scope='text, record'>
          <a @click='handleEditItem(record)'>编辑</a>

          <a-divider type='vertical' />
          <a-dropdown>
            <a class='ant-dropdown-link'>更多 <a-icon type='down' /></a>
            <a-menu slot='overlay'>
              <a-menu-item>
                <a @click='handleDetailItem(record)'>详情</a>
              </a-menu-item>
              <a-menu-item>
                <a-popconfirm title='确定删除吗?' @confirm='() => handleDeleteItem(record.id)'>
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>
        </a-table>

      </a-table>
    </div>

    <ach-achievement-standard-modal ref='modalForm' @ok='modalFormOk'></ach-achievement-standard-modal>
    <!-- 子明细编辑model -->
    <ach-achieve-standard-item-modal ref='modalItemForm' @ok='modalItemFormOk'></ach-achieve-standard-item-modal>

    <!-- 给试卷评分标准分配 弹窗 a-modal-->
    <div>
      <a-modal title='分配评分标准给对象（试卷等）' :visible='achieStandDistributionVisible' @ok='relAchStandardDistributionOk'
               @cancel='achieStandDistributionVisibleCancel' width='40%'>
        <a-row>
          <a-col :span='24'>
            <a-form-model-item label='成绩评分标准' :labelCol='labelCol' :wrapperCol='wrapperCol'
                               prop='achievementStandardId'>
              <!--              <a-input v-model="achieveStandDistributionModel.achievementStandardId" placeholder="请输入成绩评分标准"  ></a-input>-->
              <j-dict-select-tag type='list' style='width: 80%'
                                 v-model='achieveStandDistributionModel.achievementStandardId'
                                 dictCode='ach_achievement_standard , achievement_standard_name, id'
                                 placeholder='请输入成绩评分标准' />
            </a-form-model-item>
          </a-col>
          <a-col :span='24'>
            <a-form-model-item label='关联应用对象类型' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='relObjType'>
              <!--              <a-input v-model="achieveStandDistributionModel.relObjType" placeholder="请输入关联应用对象类型"  ></a-input>-->
              <j-dict-select-tag type='list' v-model='achieveStandDistributionModel.relObjType' style='width: 80%'
                                 @change='relObjTypeChange'
                                 dictCode='achievement_rel_obj_type' placeholder='请输入关联应用对象类型' />
            </a-form-model-item>
          </a-col>
          <a-col :span='24'>
            <a-form-model-item label='关联对象(试卷)' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='relObjId'>
              <!--              <a-input v-model="achieveStandDistributionModel.relObjId" placeholder="请输入关联对象"  ></a-input>-->
              <j-dict-select-tag type='list' style='width: 80%' v-model='achieveStandDistributionModel.relObjId'
                                 :dictCode=vDict placeholder='请输入关联对象' />
            </a-form-model-item>
          </a-col>
          <a-col :span='24'>
            <a-form-model-item label='所属部门编码' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='sysOrgCode'>
              <!--              <a-input v-model="achieveStandDistributionModel.sysOrgCode" placeholder="请输入所属部门编码"  ></a-input>-->
              <j-dict-select-tag type='list' style='width: 80%' v-model='achieveStandDistributionModel.sysOrgCode'
                                 dictCode='sys_depart,depart_name,org_code' placeholder='请输入所属部门编码' />
            </a-form-model-item>
          </a-col>
          <a-col :span='24'>
            <a-form-model-item label='是否有效' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='paperStandardEffective'>
              <j-dict-select-tag type='list' style='width: 80%'
                                 v-model='achieveStandDistributionModel.paperStandardEffective'
                                 dictCode='valid_status' placeholder='请选择是否有效' />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-modal>
    </div>
  </a-card>
</template>

<script>

import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import AchAchievementStandardModal from './modules/AchAchievementStandardModal'
import { deleteAction, getAction, postAction } from '@api/manage'
import AchAchieveStandardItemModal from './modules/AchAchieveStandardItemModal'
import { getDepartDataList } from '@api/commonAPI'
import { getAchAchievStandardList, getAllAchExaminationPaperList } from '@api/achievementCommonAPI'

export default {
  name: 'AchAchievementStandardList',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    AchAchievementStandardModal,
    AchAchieveStandardItemModal
  },
  data() {
    return {
      vDict: 'ach_examination_paper , examination_paper_name, id',
      description: 'ach_achievement_standard管理页面',
      //条件查询参数
      dataSourceStandard: [],
      serchParams: {
        id: null,
        subjectId: null,
        achievementStandardCode: null,
        achievementStandardName: null,
        achievementStandardTtype: null,
        achievementStandardPurpose: '11',
        achievementStandardOrder: null,
        izOpen: 1,
        sysOrgCode: null,
        tenantId: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null
      },
      // 表头
      columns: [
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          width: 70,
          scopedSlots: { customRender: 'action' }
        },
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '评分科目',
          align: 'center',
          width: 100,
          dataIndex: 'subjectName'
        },
        {
          title: '标准编码',
          align: 'center',
          width: 100,
          dataIndex: 'achievementStandardCode'
        },
        {
          title: '标准名称',
          align: 'center',
          width: 100,
          dataIndex: 'achievementStandardName'
        },
        {
          title: '标准类型',
          align: 'center',
          width: 100,
          dataIndex: 'achievementStandardTtype_dictText'
        },
        {
          title: '标准用途',
          align: 'center',
          width: 100,
          dataIndex: 'achievementStandardPurpose_dictText'
        },
        {
          title: '标准用途类型',
          align: 'center',
          width: 100,
          dataIndex: 'achiStandPurposeType_dictText'
        },
        {
          title: '标准序号',
          align: 'center',
          width: 80,
          dataIndex: 'achievementStandardOrder'
        },
        {
          title: '是否启用',
          align: 'center',
          width: 80,
          dataIndex: 'izOpen_dictText'
        },
        {
          title: '所属部门',
          align: 'center',
          width: 100,
          dataIndex: 'sysOrgName'
        },
        {
          title: '是否删除',
          align: 'center',
          width: 80,
          dataIndex: 'delFlag_dictText'
        },
        {
          title: '创建人',
          align: 'center',
          width: 100,
          dataIndex: 'createBy'
        },
        {
          title: '创建时间',
          align: 'center',
          width: 100,
          sorter: true,
          dataIndex: 'createTime',
          customRender: function(text) {
            return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
          }
        }
        // {
        //   title:'修改人',
        //   align:"center",
        //   dataIndex: 'updateBy'
        // },
        // {
        //   title: '操作',
        //   dataIndex: 'action',
        //   align:"center",
        //   fixed:"right",
        //   width:147,
        //   scopedSlots: { customRender: 'action' }
        // }
      ],
      // 评分标准明细表头
      innerColumns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '所属上级标准',
          align: 'center',
          width: 150,
          dataIndex: 'achievementStandardName'
        },
        {
          title: '科目',
          align: 'center',
          width: 100,
          dataIndex: 'subjectName'
        },
        {
          title: '分项Code',
          align: 'center',
          width: 100,
          dataIndex: 'exaPapProItemCode'
        },
        {
          title: '标准分项编码',
          align: 'center',
          width: 100,
          dataIndex: 'standItemCode'
        },
        {
          title: '标准分项目名称',
          align: 'center',
          width: 100,
          dataIndex: 'standItemName'
        },
        {
          title: '标准分项目别名',
          align: 'center',
          width: 80,
          dataIndex: 'standItemAliasname'
        },
        {
          title: '最低分(含)',
          align: 'center',
          width: 80,
          dataIndex: 'standItemLowestScore'
        },
        {
          title: '最高分(不含)',
          align: 'center',
          width: 80,
          dataIndex: 'standItemHighestScore'
        },
        {
          title: '最低分率百分比(含)',
          align: 'center',
          width: 100,
          dataIndex: 'standItemLowestRate'
        },
        {
          title: '最高分率百分比(不含)',
          align: 'center',
          width: 100,
          dataIndex: 'standItemHighestRate'
        },
        {
          title: '标准分项评分实际得分',
          align: 'center',
          width: 100,
          dataIndex: 'standItemActualScore'
        },
        {
          title: '特殊限制',
          align: 'center',
          width: 100,
          dataIndex: 'standItSpecialRestrictions'
        },
        {
          title: '特殊限制数最小值（含即大于等于或等于）',
          align: 'center',
          width: 100,
          dataIndex: 'sitemSpecRestMinvalue'
        },
        {
          title: '特殊限制数最大值（不含或小于）',
          align: 'center',
          width: 100,
          dataIndex: 'sitemSpecRestMaxvalue'
        },
        {
          title: '项目序号',
          align: 'center',
          width: 80,
          sorter: true,
          dataIndex: 'standItemOrder'
        },
        {
          title: '上级项目',
          align: 'center',
          width: 100,
          dataIndex: 'standItemFatherId'
        },
        {
          title: '是否启用',
          align: 'center',
          width: 100,
          dataIndex: 'izOpen_dictText'
        },
        {
          title: '所属部门',
          align: 'center',
          width: 100,
          dataIndex: 'sysOrgName'
        },
        {
          title: '是否删除',
          align: 'center',
          width: 100,
          dataIndex: 'delFlag'
        },
        {
          title: '创建人',
          align: 'center',
          width: 100,
          dataIndex: 'createBy'
        },
        {
          title: '创建时间',
          align: 'center',
          width: 100,
          dataIndex: 'createTime',
          customRender: function(text) {
            return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text)
          }
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 147,
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: '/achachievementstandard/achAchievementStandard/getVoAll',
        delete: '/achachievementstandard/achAchievementStandard/delete',
        deleteBatch: '/achachievementstandard/achAchievementStandard/deleteBatch',
        exportXlsUrl: '/achachievementstandard/achAchievementStandard/exportXls',
        importExcelUrl: 'achachievementstandard/achAchievementStandard/importExcel',

        //明细数据
        achievementStandardList: '/achachievestandarditem/achAchieveStandardItem/listBystandardId',
        achievementStandardDelete: '/achachievestandarditem/achAchieveStandardItem/delete',

        //评分标准分配给对象
        addRelAchieStandDistribution: '/relachstandarddistribution/relAchStandardDistribution/add'

      },
      dictOptions: {},
      superFieldList: [],
      expandedRowKeys: [],
      //标准明细数据
      itemDataSource: [],
      achieStandDistributionVisible: false,
      achieveStandDistributionModel: {
        id: null,
        achievementStandardId: null,
        relObjType: '1',
        relObjId: null,
        sysOrgCode: null,
        paperStandardEffective: 1,
        tenantId: null,
        createTime: null
      },
      departDataList: [],
      achAchievStandardList: [],//评分标准
      achExaminationPaperList: [], //试卷
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 16 }
      }
    }
  },
  created() {
    this.getSuperFieldList()
    this.getChildTable()
    this.getDepartData()
    this.getAchAchievementStandard()
    this.getAchAchievStandardData()
    this.getAchExaminationPaperData()
  },
  computed: {
    importExcelUrl: function() {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    }
  },
  methods: {
    initDictConfig() {
    },
    relObjTypeChange() {
      let type = this.achieveStandDistributionModel.relObjType
      console.log('TYPE === ' + type)
      switch (type) {
        case '9':
          this.vDict = 'ach_examination , examination_name, id'
          break
        case '92' :
          this.vDict = 'ach_examination , examination_name, id'
          break
        case '93' :
          this.vDict = 'ach_examination , examination_name, id'
          break
        default:
          this.vDict = 'ach_examination_paper , examination_paper_name, id'
      }
      this.achieveStandDistributionModel.relObjId = ''
      console.log(this.vDict)
    },
    getSuperFieldList() {
      let fieldList = []
      fieldList.push({ type: 'string', value: 'subjectId', text: '科目id', dictCode: '' })
      fieldList.push({ type: 'string', value: 'achievementStandardCode', text: '标准编码', dictCode: '' })
      fieldList.push({ type: 'string', value: 'achievementStandardName', text: '标准名称', dictCode: '' })
      fieldList.push({
        type: 'int',
        value: 'achievementStandardTtype',
        text: '标准类型（1国标 2省标 3市区标 4县乡标 5本校标 6自定义标）',
        dictCode: ''
      })
      fieldList.push({
        type: 'string',
        value: 'achievementStandardPurpose',
        text: '标准用途：11试卷模板 12实际应用于试卷 21个人模板 22应用于个人 31班级模板 32应用于班级 41年级模板 42应用于年级 51学校级模板 52应用于学校',
        dictCode: ''
      })
      fieldList.push({
        type: 'string',
        value: 'achiStandPurposeType',
        text: '标准用途类型(用途的子类型，字典码achi_stand_purpose_type),1优良及格标准 2分档标准 3分数线标准 4分段标准 5临界标准 9计分规则',
        dictCode: ''
      })
      fieldList.push({ type: 'int', value: 'achievementStandardOrder', text: '标准序号', dictCode: '' })
      fieldList.push({ type: 'int', value: 'izOpen', text: '是否启用(1是启用，0否停用)', dictCode: '' })
      fieldList.push({ type: 'string', value: 'tenantId', text: '学校id', dictCode: '' })
      fieldList.push({ type: 'int', value: 'delFlag', text: '0表示未删除,1表示删除', dictCode: '' })
      fieldList.push({ type: 'string', value: 'createBy', text: '创建人', dictCode: '' })
      fieldList.push({ type: 'date', value: 'createTime', text: '创建时间' })
      fieldList.push({ type: 'string', value: 'updateBy', text: '修改人', dictCode: '' })
      fieldList.push({ type: 'date', value: 'updateTime', text: '修改时间' })
      this.superFieldList = fieldList
    },
    onSelectChangeItem() {

    },
    //条件查询
    whereSerchAchAchieStandard() {
      this.getAchAchievementStandard()
    },
    //重置查询条件
    whereSerchAchAchieStandardInit() {
      this.serchParams = []
      this.getAchAchievementStandard()
    },
    getAchAchievementStandard() {
      let achAchievementStandard = this.serchParams
      getAction(this.url.list, achAchievementStandard).then((res) => {
        if (res.success) {
          this.dataSourceStandard = res.result.records
        } else {
          this.$message.error('暂无数据或获取失败')
        }
      })
    },
    fatherExpand(expanded, record) {
      if (expanded) {
        this.expandedRowKeys.push(record.id)
        this.getChildTable(record)
      } else {
        this.expandedRowKeys.splice(this.expandedRowKeys.indexOf(record.id), 1)
      }
    },
    getChildTable(record) {
      let params = {}
      if (record != null) {
        params.achievementStandardId = record.id
      }
      getAction(this.url.achievementStandardList, params).then(res => {
        if (res.success) {
          this.itemDataSource = res.result
        } else {
          this.$message.error(res.message)
        }
      })
    },
    //上方试卷table单选选择触发
    onSelectChange(selectedRowKeys, selectionRows) {
      this.selectedRowKeys = selectedRowKeys
      this.selectionRows = selectionRows
      this.$refs.modalItemForm.getOrderMain(this.selectionRows[0]) //selectionRows当前选择的顶级标准数据
      // let index = selectedRowKeys[0] //项目获取方法调用，当前选择试卷id参数
    },
    //标准明细编辑
    handleEditItem: function(record) {
      this.$refs.modalItemForm.edit(record)
      this.$refs.modalItemForm.title = '编辑'
      this.$refs.modalItemForm.disableSubmit = false
    },
    //标准明细 新增
    handleAddItem: function() {
      if (this.selectionRows.length > 1) {
        alert('新增时顶级标准只能选一个')
        return null
      } else if (this.selectionRows.length < 1) {
        alert('请先选择一条评分顶级标准')
        return null
      }
      this.$refs.modalItemForm.add()
      this.$refs.modalItemForm.title = '新增'
      this.$refs.modalItemForm.disableSubmit = false
    },
    modalItemFormOk() {
      // 新增/修改 成功时，重载列表
      this.loadData()
      //清空列表选中
      this.onClearSelected()
    },
    //标准明细详情
    handleDetailItem: function(record) {
      this.$refs.modalItemForm.edit(record)
      this.$refs.modalItemForm.title = '详情'
      this.$refs.modalItemForm.disableSubmit = true
    },
    //标准明细删除
    handleDeleteItem: function(id) {
      var that = this
      deleteAction(that.url.achievementStandardDelete, { id: id }).then((res) => {
        if (res.success) {
          //重新计算分页问题
          that.reCalculatePage(1)
          that.$message.success(res.message)
          that.loadData()
        } else {
          that.$message.warning(res.message)
        }
      })
    },
    //开始给试卷分配评分标准
    addAchieveStandardPaper() {
      this.achieStandDistributionVisible = true
    },
    achieStandDistributionVisibleCancel() {
      this.achieStandDistributionVisible = false
    },
    //提交评分标准分配试卷
    relAchStandardDistributionOk() {
      let relAchStandardDistribution = this.achieveStandDistributionModel
      var that = this
      postAction(that.url.addRelAchieStandDistribution, relAchStandardDistribution).then((res) => {
        if (res.code === 200) {
          this.$message.success('分配成功')
          this.achieStandDistributionVisible = false
        } else {
          this.$message.error('分配失败')
        }
      })
    },
    async getDepartData() {
      let res = await getDepartDataList()
      this.departDataList = []
      res.result.forEach(item => {
        this.departDataList.push({
          label: item.departName,
          value: item.orgCode
        })
      })
    },
    //获取分配时下拉的评分标准数据
    async getAchAchievStandardData() {
      let res = await getAchAchievStandardList()
      this.achAchievStandardList = []
      if (res.success) {
        res.result.records.forEach(item => {
          this.achAchievStandardList.push({
            label: item.achievementStandardName,
            value: item.id
          })
        })
      } else {
        this.$message.error(res.message)
      }
    },
    //获取试卷
    async getAchExaminationPaperData() {
      let res = await getAllAchExaminationPaperList()
      this.achExaminationPaperList = []
      res.result.records.forEach(item => {
        this.achExaminationPaperList.push({
          label: item.examinationPaperName,
          value: item.id
        })
      })
    }


  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>